<template>
  <div class="workspace-main">
    <!-- 工作台欢迎界面 -->
    <div class="welcome-section">
      <div class="welcome-content">
        <h1>欢迎使用员工工作台</h1>
        <p>请从左侧菜单选择您需要的功能</p>
      </div>
    </div>
    
    <!-- 快速操作区 -->
    <div class="quick-actions">
      <div class="action-card" @click="navigateTo('/workspace/finance')">
        <div class="icon-container icon-finance">
          <i class="iconfont icon-money"></i>
        </div>
        <h3>财务管理</h3>
        <p>查看和管理您的财务信息</p>
      </div>
      
      <div class="action-card" @click="navigateTo('/workspace/orders')">
        <div class="icon-container icon-orders">
          <i class="iconfont icon-order"></i>
        </div>
        <h3>订单状态</h3>
        <p>查看您的订单处理情况</p>
      </div>
      
      <div class="action-card" @click="navigateTo('/workspace/messages')">
        <div class="icon-container icon-messages">
          <i class="iconfont icon-message"></i>
        </div>
        <h3>消息中心</h3>
        <p>查看最新消息通知</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const navigateTo = (path) => {
  router.push(path);
};
</script>

<style lang="less" scoped>
.workspace-main {
  padding: 20px;
  min-height: calc(100vh - 120px); // 考虑顶部导航栏高度
}

.welcome-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  
  .welcome-content {
    max-width: 600px;
    margin: 0 auto;
    
    h1 {
      font-size: 32px;
      color: #333;
      margin-bottom: 10px;
      font-weight: 600;
    }
    
    p {
      font-size: 16px;
      color: #666;
      margin: 0;
    }
  }
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.action-card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  
  &:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }
  
  .icon-container {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 30px;
    
    &.icon-finance {
      background: #e6f7ff;
      color: #1890ff;
    }
    
    &.icon-orders {
      background: #f6ffed;
      color: #52c41a;
    }
    
    &.icon-messages {
      background: #fff7e6;
      color: #faad14;
    }
    
    .iconfont {
      font-size: 32px;
    }
  }
  
  h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 8px;
    font-weight: 500;
  }
  
  p {
    font-size: 14px;
    color: #999;
    margin: 0;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .workspace-main {
    padding: 15px;
  }
  
  .welcome-section {
    padding: 30px 15px;
    
    .welcome-content h1 {
      font-size: 24px;
    }
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .action-card {
    padding: 20px;
  }
}
</style>